class Fruit(object):
    def __init__(self, name, price):
        self.name = name
        self.price = price

    # 父类
    def mekejuice(self):
        print(f'{self.name}制作果汁{self.price}元')


# 子类
class Apple(Fruit):
    # def mekejuice(self):
    #     print('苹果制作苹果汁')
    pass


class Orange(Fruit):
    # def mekejuice(self):
    #     print('橘子制作橘子汁')
    pass


class Banana(Fruit):
    # def mekejuice(self):
    #     print('香蕉制作香蕉汁')
    pass


# 公共方法
def make_juice(fruit):
    # fruit--- 传入的对象
    fruit.mekejuice()  # 调用当前对象的方法
    print(fruit)


make_juice(Apple('苹果', 10))
make_juice(Orange('橘子', 5))
make_juice(Banana('香蕉', 3))
